#include "OthelloPlayerInfo.h"
#include "../framework/Player.h"
#include "../framework/GameActivity.h"
#include "OthelloPlayer.h"

#include <iostream>

void OthelloPlayerInfo::update(GameActivity * game){
    Player* player;
    OthelloPlayer* othelloPlayer;
    if((player = game->getPlayer(_side))!=NULL){
        othelloPlayer = dynamic_cast<OthelloPlayer*>(player);
        this->setText(QString::number(othelloPlayer->getScore()));
    }
    else{
        this->setText(QString::number(2));
    }
}

void OthelloPlayerInfo::setSide(std::string side){
    _side = side;
}

std::string OthelloPlayerInfo::getSide(){
    return _side;
}
